<?php

/**
 * member filter form base class.
 *
 * @package    sf_sandbox
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasememberFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'ClassName'          => new sfWidgetFormChoice(array('choices' => array('' => '', 'Member' => 'Member'))),
      'Created'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'LastEdited'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'FirstName'          => new sfWidgetFormFilterInput(),
      'Surname'            => new sfWidgetFormFilterInput(),
      'Email'              => new sfWidgetFormFilterInput(),
      'Password'           => new sfWidgetFormFilterInput(),
      'RememberLoginToken' => new sfWidgetFormFilterInput(),
      'NumVisit'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'LastVisited'        => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'Bounced'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'AutoLoginHash'      => new sfWidgetFormFilterInput(),
      'AutoLoginExpired'   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'PasswordEncryption' => new sfWidgetFormFilterInput(),
      'Salt'               => new sfWidgetFormFilterInput(),
      'PasswordExpiry'     => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'LockedOutUntil'     => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'Locale'             => new sfWidgetFormFilterInput(),
      'FailedLoginCount'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'DateFormat'         => new sfWidgetFormFilterInput(),
      'TimeFormat'         => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'ClassName'          => new sfValidatorChoice(array('required' => false, 'choices' => array('Member' => 'Member'))),
      'Created'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'LastEdited'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'FirstName'          => new sfValidatorPass(array('required' => false)),
      'Surname'            => new sfValidatorPass(array('required' => false)),
      'Email'              => new sfValidatorPass(array('required' => false)),
      'Password'           => new sfValidatorPass(array('required' => false)),
      'RememberLoginToken' => new sfValidatorPass(array('required' => false)),
      'NumVisit'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'LastVisited'        => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'Bounced'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'AutoLoginHash'      => new sfValidatorPass(array('required' => false)),
      'AutoLoginExpired'   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'PasswordEncryption' => new sfValidatorPass(array('required' => false)),
      'Salt'               => new sfValidatorPass(array('required' => false)),
      'PasswordExpiry'     => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'LockedOutUntil'     => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'Locale'             => new sfValidatorPass(array('required' => false)),
      'FailedLoginCount'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'DateFormat'         => new sfValidatorPass(array('required' => false)),
      'TimeFormat'         => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('member_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'member';
  }

  public function getFields()
  {
    return array(
      'ID'                 => 'Number',
      'ClassName'          => 'Enum',
      'Created'            => 'Date',
      'LastEdited'         => 'Date',
      'FirstName'          => 'Text',
      'Surname'            => 'Text',
      'Email'              => 'Text',
      'Password'           => 'Text',
      'RememberLoginToken' => 'Text',
      'NumVisit'           => 'Number',
      'LastVisited'        => 'Date',
      'Bounced'            => 'Number',
      'AutoLoginHash'      => 'Text',
      'AutoLoginExpired'   => 'Date',
      'PasswordEncryption' => 'Text',
      'Salt'               => 'Text',
      'PasswordExpiry'     => 'Date',
      'LockedOutUntil'     => 'Date',
      'Locale'             => 'Text',
      'FailedLoginCount'   => 'Number',
      'DateFormat'         => 'Text',
      'TimeFormat'         => 'Text',
    );
  }
}
